System service reloading method and apparatus

ABSTRACT

The present invention discloses a system service reloading method including receiving a call request for calling a system service, wherein the system service includes at least two service processes having same configuration information recording at least port information and socket information; according to a pre-configured service reloading state, determining whether to perform a system service reloading, wherein the service reloading state includes at least an open state and a close state; when the service reloading state is the open state, obtaining a process attribute corresponding to the service processes, wherein the process attribute is used to record a creation order of the service processes; and according to the process attribute, choosing one of the service processes in the system service to respond to the call request. The present invention solves the technical problem of the prolonged system service time delay during the reloading period caused by the system service reloading.

FIELD OF THE DISCLOSURE

The present disclosure generally relates to the field of the Internetand, more particularly, relates to a system service reloading method andapparatus.

BACKGROUND

In many types of operating systems, a variety of system services may beused in operation to achieve various functions. The service processes ofsome system services used to provide network services must be restartedto complete the configuration file reloading or the service processupdating.

Taking the Linux HAProxy network service as an example, this networkservice is implemented by using the SO_REUSEPORT option. After bindingthe newly created service process to the same network address (IPaddress) and network port as the original service process, it listens tothe socket of the newly created service process. When a new serviceprocess is created, a notification signal is sent to the originalservice process to close the listening socket on the listening port.However, when both the newly created service process and the originalservice process bind to a same IP address and a same network port, andthe listening socket of the original service process is not yet closed,the first packet (SYN packet) of a new connection request from anexternal client has an equal probability of being assigned to either thenew service process or the original service process according to theimplementation method of the existing Linux kernel SO-REUSEPORT option.When the SYN packet is assigned to the original service process, and thelistening socket of the original service process is immediately closed,based on the TCP protocol, the operating system will send a reset packet(TCP RST) to the external device to reset the connection.

Currently, some solutions exist for the problem described above. Forexample, a filtering rule (iptables rule) may be configured during theservice process reloading to discard newly received SYN packets.According to the TCP protocol, after not receiving the SYN/ACK packetsfor a period of time, the client resends the SYN packet to reset theconnection. By using the above solution, although the new connectionwill not be reset, it takes a long time, usually longer than about onesecond, for the client to wait for the connection timeout and to resendthe SYN packet. While the service process reloading time is often onlytens of milliseconds, the TCP connection delay is relatively long.

In another solution, Linux traffic control tool (TC, traffic control) isused. Firstly, a filtering rule is used to mark the new SYN packet sentfrom the client. Then, the new SYN packet is temporarily cached by theTC. After the service process is reloaded, the SYN packet cached by theTC is released. Although the above solution has a relatively shortdelay, the applicable scenario may be limited because the TC tool canonly be used to control the outflow of data traffic.

The above described problem of long delay in system service caused byreloading of the system service has not been solved effectively.

BRIEF SUMMARY OF THE DISCLOSURE

The disclosed embodiments of the present invention provide a method andan apparatus for the system service reloading so as to at least solvethe technical problem of the prolonged system service time delay duringthe reloading period caused by the system service reloading.

One aspect of the disclosed embodiments of the present inventionprovides a system service reloading method including: receiving a callrequest for calling a system service, wherein the system serviceincludes at least two service processes having same configurationinformation recording at least port information and socket information;according to a pre-configured service reloading state, determiningwhether to perform system service reloading, wherein the servicereloading state includes at least an open state and a close state; whenthe service reloading state is the open state, obtaining a processattribute corresponding to the service processes, wherein the processattribute is used to record a creation order of the service processes;and according to the process attribute, choosing one of the serviceprocesses in the system service to respond to the call request.

Further, before receiving the call request for calling the systemservice, the method further includes: obtaining configurationinformation of a first service process in operation, wherein theconfiguration information includes at least information about a socketcorresponding to the first service process; according to theconfiguration information, creating a second service process; andswitching the service reloading state to the open state, and afterchoosing one of the service processes in the system service to respondto the call request according to the process attribute, the methodfurther includes: switching the service reloading state to the closestate; and terminating the service process that is not used to respondto the call request.

Further, when the process attribute is in a form of a characterparameter and after the second service process is created according tothe configuration information, the method further includes: configuringthe character parameter in the configuration information correspondingto the second service process, wherein the character parameter is usedto mark the socket of the newly created service process.

Further, choosing one of the service processes in the system service torespond to the call request according to the process attribute furtherincludes: obtaining a calculated process value corresponding to eachservice processes; and determining one of the service processes torespond to the call request according to the calculated process value.

Further, performing a calculation process on the service processes inthe system service according to the character parameter includes:performing a weighted calculation on the service processes in the systemservice according to the character parameter; and/or performing anaccumulated calculation on the service processes in the system serviceaccording to the character parameter.

Further, when the service reloading state is the close state, the methodfurther includes: performing a restoration and reset operation on thelabel of the socket of the second service process.

Further, when the process attributes are in a form of a time parameterrecording a service process creation time, choosing one of the serviceprocesses in the system service to respond to the call request accordingto the process attributes includes: comparing the time parameters of allservice processes with a system restart time; determining target serviceprocesses according to the comparison results, wherein the targetservice process is a service process that has a positive time differencebetween its time parameter and the system restart time; and randomlyselecting a target service process among the target service processes asthe service process to respond to the call request.

Another aspect of the disclosed embodiments of the present inventionalso provides a system service reloading apparatus, comprising: areceiving module configured to receive a call request calling for asystem service, wherein the system service includes at least two serviceprocesses having the same configuration information; a processing moduleconfigured to determine whether to perform a system service reloadingaccording to a pre-configured service reloading state, wherein theservice reloading state includes at least an open state and a closestate; a first acquisition module configured to obtain a processattribute corresponding to the service processes when the servicereloading state is the open state, wherein the process attribute is usedto record a creation order of the service process; and a choosing moduleconfigured to choose one of the service processes in the system serviceto respond to the call request according to the process attribute.

Further, the apparatus also includes: a second acquisition moduleconfigured to obtain configuration information of a first serviceprocess in operation, wherein the configuration information includes atleast information about a socket corresponding to the first serviceprocess; a creation module configured to create a second service processaccording to the configuration information; a first configuration moduleconfigured to configure the service reloading state to the open state; asecond configuration module configured to configure the servicereloading state to the close state; and a termination module configuredto terminate the service process that is not used to respond to the callrequest.

Further, when the process attribute is in a form of a characterparameter, the apparatus also includes: a first marking moduleconfigured to configure a character parameter in the configurationinformation corresponding to the second service process, wherein thecharacter parameter is used to mark the socket of the newly createdservice process.

Further, the determination module includes: a calculation unitconfigured to perform calculations on the service processes in thesystem service according to the character parameters to obtain acalculated process value corresponding to each service process; and afirst determination unit configured to determine one of the serviceprocesses to respond to the call request according to the calculatedprocess value.

Further, the calculation unit is configured to: perform weightedcalculations on the service processes in the system service according tothe character parameter; and/or perform accumulated calculations on theservice processes in the system service according to the characterparameter.

Further, when the service reloading state is the close state, theapparatus further includes: a marker restoration module configured toperform a restoration and reset process on the label of the socket ofthe second service process.

Further, when the process attribute is in a form of a time parameterrecording a service process creation time, the choosing module includes:a comparing unit configured to compare the time parameters of allservice processes with a system restart time; a second determining unitconfigured to determine target service processes according to thecomparison results, wherein the target service process is a serviceprocess that has a positive time difference between its time parameterand the system restart time; and a selecting unit configured to randomlyselect a target service process among the target service processes asthe service process to respond to the call request.

In various embodiments of the present invention, the method includes thefollowing steps. A call request for calling a system service isreceived, where the system service includes at least two serviceprocesses having the same configuration information. According to apre-configured service reloading state, whether to perform the systemservice reloading is determined. The service reloading state includes atleast an open state and a close state. When the service reloading stateis the open state, a process attribute corresponding to the serviceprocess is obtained, where the process attribute is used to record thecreation order of the service process. According to the serviceattribute, the service process in the system service to respond to thecall request is determined. Thus, the objective of selecting the serviceprocess is achieved, and the technical effect of the uninterruptedsystem service updating is realized. The present invention solves thetechnical problem of the prolonged system service time delay during thereloading period caused by the system service reloading.

BRIEF DESCRIPTION OF THE DRAWINGS

The drawings described herein are intended to facilitate furtherunderstanding of the present invention and form a part of thespecification. The illustrative embodiments and descriptions thereof areintended to illustrate the present invention and are not to be construedas limiting the scope of the present invention. In the drawings:

FIG. 1 illustrates a flow chart of an exemplary system service reloadingmethod according to the disclosed embodiments of the present invention;

FIG. 2 illustrates a flow chart of another exemplary system servicereloading method according to the disclosed embodiments of the presentinvention;

FIG. 3 illustrates a schematic diagram of an exemplary system servicereloading apparatus according to the disclosed embodiments of thepresent invention; and

FIG. 4 illustrates a schematic diagram of another exemplary systemservice reloading apparatus according to the disclosed embodiments ofthe present invention.

DETAILED DESCRIPTION

In order to provide those skilled in the art with a better understandingof the present invention, the technical solutions according to thepresent invention are further described in detail with reference to theaccompanying drawings of the exemplary embodiments. It should beunderstood that the exemplary embodiments described herein are only apart of the embodiments of the present invention, but not allembodiments of the present invention. Based on the described exemplaryembodiments, other embodiments obtained by those of ordinary skill inthe art without creative effort should be encompassed within the scopeof the present invention.

It should be noted that the terms “first”, “second” and the like in thespecification and claims of the present invention and theabove-described drawings are used to distinguish similar objects, andare not necessarily used to describe a specific order or precedence. Itshould be understood that the data thus used may be interchangeable asappropriate so that the embodiments of the present invention describedherein can be implemented in an order other than those illustrated ordescribed herein. In addition, the terms “comprise”, “have” and theirvariations are intended to cover non-exclusive inclusion. For example,processes, methods, systems, products, or devices comprising a pluralityof steps or units are not necessarily limited to those clearly listedsteps or units, but may include other steps or units that are notexplicitly listed or inherent to such processes, methods, products, ordevices.

According to the disclosed embodiments, the present disclosure providesa system service reloading method. It should be noted that the stepsshown in the flow chart of the drawings may be a set of computerexecutable instructions to be executed in a computer system. Further,although the flow chart shows the logic sequence, in some cases, thesteps shown or described may be performed in a different order.

FIG. 1 illustrates a flow chart of an exemplary system service reloadingmethod according to the present disclosure. As shown in FIG. 1, themethod comprises the following steps.

Step S21: receiving a call request for calling a system service, whereinthe system service includes at least two service processes having sameconfiguration information recording at least port information and socketinformation.

Specifically, in the operating system, system services are often used toachieve a variety of specific functions. In the process of updating thesystem services, in order to reduce the impact on the functions achievedby the system services due to the updating, a service process having thesame configuration information as the original service process may becreated before terminating the original service process. The serviceprocess may run concurrently with the original service process. When thenewly created service process is successfully created and started, theoriginal service process can then be terminated.

Step S23: according to a pre-configured service reloading state,determining whether to perform a system service reloading, wherein theservice reloading state includes at least an open state and a closestate.

Specifically, before updating the system service, an updating label or alabel of the service reloading state may be configured in advance. Whenthe system service is called, the service reloading state may beobtained to determine whether the system service is being updated. Theopen state is used to indicate the system service is in the reloadingstate while the close state is used to indicate the system service isnot in the reloading state.

Step S25: when the service reloading state is the open state, obtaininga process attribute corresponding to the service processes, wherein theprocess attribute is used to record a creation order of the serviceprocesses.

Specifically, when the service reloading state is the open state, itindicates that there may be at least two service processes with the sameconfiguration information in the system service. In order to make thecall request properly sent to the newly created service process, theprocess attribute recorded at the time of service process creation maybe obtained before calling the system service. The process attribute maybe used to determine the creation order of the service processes havingthe same configuration information to distinguish between the originalservice process and the newly created service process.

Step S27: according to the process attribute, choosing one of theservice processes in the system service to respond to the call request.

Specifically, after the process attribute corresponding to the serviceprocess is used to determine the creation order of the service process,the call request is sent to the later created service process to avoidthe occurrence of system service interruption caused by the originalservice process termination after the updating ends.

Through the steps from S21 to S27, when the newly created serviceprocess and the original service process share the same configurationinformation and run concurrently, the process attributes may be used todistinguish between the newly created service process and the originalservice process. All the call requests received at this time may beprocessed by the newly created service process, thus achieving theobjective of selecting service processes and the technical effect of theuninterrupted system service updating. Thus, the technical problem ofthe elongated system service delay caused by the system servicereloading can be solved.

For example, the network service in Linux system is used to illustratethe present invention in practical applications. When the Linux systemkernel receives a new connection request for establishing a TCPconnection to the system, the system may call _inet_lookup_listener( )function to look up which listening socket the SYN packet is assigned towhen the SYN packet is received from the client. Each listening socketcorresponds to a specific service process. After the listening socket(i.e., the corresponding service process) is looked up and determined,the system kernel may use a weighted scoring method to select a systemprocess matching the SYN packet according to the destination networkport and IP address, etc., contained in the SYN packet. In the case thatSO-REUSEPORT option is enabled, a plurality of sockets that bind to thesame IP address and network port may exist in the system service.Because these sockets have identical optional parameters orconfiguration information, their calculated weighted scores may be thesame as well. At this time, the system kernel may randomly select aservice process corresponding to one of the listening sockets that haveequal weighted scores.

Thus, the process attribute that records the creation order of theservice process may be added to optional parameters of the listeningsockets so that the system kernel may determine the listening socketcorresponding to the latest started service process according to theprocess attributes when the system kernel needs to select from aplurality of listening sockets that have SO_REUSEPORT option enabled,and have identical IP address and network port.

In one embodiment, as shown in FIG. 2, the method describe above mayfurther include the following steps before a call request for callingthe system service is received in the step S21.

Step S201: obtaining configuration information of a first serviceprocess in operation, wherein the configuration information includes atleast information about a socket corresponding to the first serviceprocess.

Step S203: according to the configuration information, creating a secondservice process.

Step S205: switching the service reloading state to the open state.

Further, after the service process in the system service to respond tothe call request according to the process attribute is determined in thestep S27, the method described above may include the following steps.

Step S28: switching the service reloading state to the close state.

Step S29: terminating the service process that is not used to respond tothe call request.

Specifically, before the service process is updated, the steps from S201to S205 may be used to configure the newly created second serviceprocess according to the configuration information of the original firstservice process and to create the second service process that has thesame listening socket as the first service process. After the secondservice process is created, the state is labeled in the operatingsystem, and the service reloading state is set to the open state. Thus,the system may check the service reloading state to determine whetherthe system service is in the reloading state before calling the serviceprocess. Further, after the system service reloading is completed, thesteps from S28 to S29 may be used to set the service reloading state tothe close state, and to terminate the original service process in thesystem service.

In another embodiment, when the process attribute consists of acharacter parameter, after the second service process according to theconfiguration information is created in the step S203, the methoddescribe above may also include the following step.

Step S204 a: configuring the character parameter in the configurationinformation corresponding to the second service process, wherein thecharacter parameter is used to mark the socket of the newly createdservice process.

Specifically, the step S204 a is used to configure a member variablerecording the creation order of service process in the configurationinformation. Alternatively, the member variable may be an integer, acharacter string, or, of course, a Boolean variable. The member variableis used to distinguish between the newly created service process and theoriginal service process.

In another embodiment, when determining the service process in thesystem service to respond to the call request according to the processattribute in the step S27, the method describe above may also includethe following steps.

Step S271 a: calculating the service processes in the system serviceaccording to the character parameters to obtain a calculated processvalue corresponding to each service process.

Step S273 a: determining one of the service processes to respond to thecall request according to the calculated values.

Specifically, when the system calculates the weighted scores for theservice processes, the steps from S271 a to S273 a may be used toinclude the values of the process attributes into the service processweighted score calculation so that the newly created service process maybe determined from the service processes that have the sameconfiguration information.

In another embodiment, the calculation process for the service processesin the system service according to the character parameter may include:performing a weighted calculation for the service processes in thesystem service according to the character parameter, and/or performingan accumulated calculation for the service processes in the systemservice according to the character parameter.

In another embodiment, when the service reloading state is in the closestate, the method described above may also include: performing arestoration and reset operation on the label for the listening socket ofthe second service process. In this way, the label is restored and resetto avoid disruptions and crushes in the next restarting process.

In another embodiment, when the process attributes are in a form of atime parameter recording a service process creation time, choosing oneof the service processes in the system service to respond to the callrequest according to the process attributes may include: comparing thetime parameters of all service processes with a system restart time;determining target service processes according to the comparisonresults, wherein the target service process is a service process thathas a positive time difference between its time parameter and the systemrestart time; randomly selecting a target service process among thetarget service processes as the service process to respond to the callrequest.

For example, the network service in Linux system is used to illustratethe present invention in practical applications. When the SYN packet isreceived, the creation time of the service process may be determined byquerying the configuration information related to the service process.At the same time, the current system time of the operating system isobtained. The current system time is compared with the creation timecorresponding to each service process to determine the latest createdservice process, which is used to respond to the call request.

In another embodiment, in Linux operating system, /proc file system is avirtual file system, through which the kernel space and user space ofLinux system may communicate with each other.

First, a kernel configuration option may be added to the/proc filesystem as a switch to control the connection assignment, e.g.,/proc/sys/net/ipv4/reuseport_mark_new. When this option is set to 0(default value), the execution behavior of the system kernel remainsunchanged. When this option is set to 1, the kernel marks the listeningsocket of the newly created service process. At the same time, in theLinux system kernel code, the struct sock structure is used to save thesocket configuration information. A new member variable may be added tothe struct sock structure to mark the socket of the newly createdservice process.

Then, before the network service reloading is executed, the kerneloption reuseport_mark_new in the proc file system is set to 1 to notifyLinux system kernel to start marking the newly created socket. When anew client sends a new SYN packet for connection to Linux system, theconnection socket may be marked by the new member variable in the structsock structure.

At this time, the network service reloading script is executed. Wheninet_lookup_listener ( ) function is used to calculate the weight of theservice process corresponding to the socket, the marked socket of thenewly created service process is assigned with additional weight so thatthe marked socket may be selected from a plurality of sockets having thesame configuration information to process the SYN packet for a newnetwork connection. On the other hand, the original service processsocket is not marked, is not assigned with any additional weight, andmay not be selected to process the new SYN packet. Thus, this ensuresthat the new SYN packet may only be processed by the newly createdservice process when the system service reloading is performed.

When the network service reloading is completed, reuseport_mark_newkernel option in the proc file system is set to 0 to restore the systemkernel to the normal behavior.

Another aspect of the present invention provides a system servicereloading apparatus. FIG. 3 illustrates a schematic diagram of anexemplary system service reloading apparatus according to the presentdisclosure.

As shown in FIG. 3, the apparatus may include: a receiving module 21, aprocessing module 23, a first acquisition module 25, and a choosingmodule 27.

The receiving module 21 is configured to receive a call request callingfor a system service. The system service includes at least two serviceprocesses having the same configuration information. The configurationinformation records at least port information and socket information.The processing module 23 is configured to determine whether to perform asystem service reloading according to a pre-configured service reloadingstate. The service reloading state includes at least an open state and aclose state. The first acquisition module 25 is configured to obtain aprocess attribute corresponding to the service processes when theservice reloading state is the open state. The process attribute isconfigured to record a creation order of the service processes. Thechoosing module 27 is configured to choose one of the service processesin the system service to respond to the call request according to theprocess attribute.

The receiving module 21, the processing module 23, the first acquisitionmodule 25, and the choosing module 27 are used to distinguish betweenthe newly created service process and the original service processaccording to the process attributes when the newly created serviceprocess and the original service process share the same configurationinformation and run concurrently. And all call requests received at thistime may be processed by the newly created service process to achievethe objective of selecting the service processes and the technicaleffect of the uninterrupted system service updating. Thus, the technicalproblem of the elongated system service delay caused by the systemservice reloading is solved.

In one embodiment, as shown in FIG. 4, the apparatus may also include asecond acquisition module 201, a creation module 203, a firstconfiguration module 205, a second configuration module 28, and atermination module 29.

The second acquisition module 201 is configured to obtain configurationinformation of a first service process in operation. The configurationinformation includes at least information about a socket correspondingto the first service process. The creation module 203 is configured tocreate a second service process according to the configurationinformation. The first configuration module 205 is configured toconfigure the service reloading state to the open state and the secondconfiguration module 28 is configured to configure the service reloadingstate to the close state. The termination module 29 is configured toterminate the service process that is not used to respond to the callrequest.

Specifically, before the service process is updated, the secondacquisition module 201, the creation module 203, and the firstconfiguration module 205 may be used to configure a newly created secondservice process according to the configuration information of theoriginal first service process to create the second service process thathas the same listening socket as the first service process. After thesecond service process is created, the operating system may mark thelistening socket and configure the service reloading state to the openstate. So the system may check the service reloading state to determinewhether the system service is in the reloading state before calling forthe service process. After the system service is reloaded, the secondconfiguration module 28 and the termination module 29 may be used toconfigure the service reloading state to the close state, and toterminate the original service process in the system service.

In another embodiment, when the process attribute is in a form of acharacter parameter, the apparatus described above may also include afirst marking module.

The first marking module is configured to configure a characterparameter in the configuration information corresponding to the secondservice process. The character parameter is used to mark the socket ofthe newly created service process.

Specifically, the first marking module may be used to configure a membervariable in the configuration information, which records the creationorder of the service process. Alternatively, the member variable may bean integer, a character string, or, of course, a Boolean variable. Themember variable is used to distinguish between the newly created serviceprocess and the original service process.

In another embodiment, the choosing module may include a calculationunit, which is configured to perform calculations on the serviceprocesses in the system service according to the character parameters toobtain a calculated process value corresponding to each service process,and a first determination unit, which is configured to choose one of theservice processes to respond to the call request according to thecalculated process value.

In another embodiment, when the process attribute is in the form ofcharacter parameter, the apparatus described above may also include afirst marking module, which is configured to configure the characterparameter in the configuration information corresponding to the secondservice process. The character parameter is used to mark the socket ofthe newly created service process.

In another embodiment, the choosing module may include a calculationunit, which is configured to perform calculations on the serviceprocesses in the system service according to the character parameters toobtain a calculated process value corresponding to each service process,where the calculation processing may include weighted calculationsand/or accumulated calculations; and a determination unit, which isconfigured to determine one of the service processes to respond to thecall request according to the calculated process value.

In another embodiment, the apparatus described above may also include athird configuration module. When the process attribute is in a form of atime parameter, the third configuration module is used to configure atime parameter in the configuration information corresponding to thesecond service process after the second service process is createdaccording to the configuration information. The time parameter is thecreation time of the second service process. Further, the choosingmodule 27 may include an acquisition unit which is configured to obtainthe current system time, and a query unit which is configured to locatethe second service process according to the calculated time differencesand to assign the second service process to respond to the call request.

The functional units and/or modules described in the embodiments of theapparatus are implemented in a manner similar to those described in theembodiments of the method, and will not be repeated herein.

The disclosed embodiments of the present invention are described forillustrative purposes only and are not to be construed as limiting thescope of the invention.

In the embodiments of the present invention described above, emphasishas been made to the description of each example. Certain aspect of theinvention that is not described in detail in certain embodiment may bereferred to the related description of the other embodiments.

It should be understood that the technical solutions disclosed in theembodiments of the present invention may be implemented in alternativemanners. The embodiments of the apparatus described above are only forillustration purpose. For example, the units are partitioned based onthe logical functions. In real life applications, other partitionmethods may be adopted. For example, a plurality of units or modules maybe combined or integrated into another system. Certain features may beignored or not implemented. Alternatively, the mutual coupling or directcoupling or communication connection illustrated or discussed above maybe performed through certain interfaces, or implemented through indirectcoupling or communication connection between the units or modules. Theinterconnection may be in the electrical form or other forms.

The elements described as separate components may or may not bephysically separated. The units shown may or may not be physical units.That is, a unit may be located in one place or may be distributed over aplurality of units. Some or all of the elements may be selectedaccording to the actual needs to achieve the objective of the presentinvention.

In addition, the functional units in the various embodiments of thepresent invention may be integrated into one processing unit orphysically present as individual units. Alternatively, two or more unitsmay be integrated into one unit. The integrated unit described above maybe implemented in the form of hardware or software functional unit.

When the integrated unit is implemented in form of software functionalunit and sold or used as standalone product, the integrated unit may bestored in a computer readable storage medium. Based on thisunderstanding, the technical solution of the present invention, eitherin part or in whole, or the portion of the contribution in addition tothe conventional solution, may be included in the software product. Thecomputer software product may be stored in the storage medium, whichincludes a plurality of instructions to make a computer (e.g., apersonal computer, a server, or a networking equipment, etc.) performthe entire or partial steps of the method described in variousembodiments of the present invention. The storage medium describe abovemay include a USB disk, a read-only memory (ROM), a random access memory(RAM), a portable hard drive, a magnetic disk, an optical disk, or anysuitable storage medium suitable for storing program instructions.

Various preferred embodiments of the present invention are describedabove. It should be noted that modifications and improvements may bemade by those skilled in the art without departing from the principlesof the present invention. Such modifications and improvements areconsidered as encompassed in the scope of the present invention.

What is claimed is:
 1. A system service reloading method, comprising:receiving a call request for calling a system service, wherein thesystem service includes at least two service processes having sameconfiguration information recording at least port information and socketinformation; according to a pre-configured service reloading state,determining whether to perform system service reloading, wherein theservice reloading state includes at least an open state and a closestate; when the service reloading state is the open state, obtaining aprocess attribute corresponding to the service processes, wherein theprocess attribute is used to record a creation order of the serviceprocesses; and according to the process attribute, choosing one of theservice processes in the system service to respond to the call request.2. The method of claim 1, wherein: before receiving the call request forcalling the system service, the method further includes: obtainingconfiguration information of a first service process in operation,wherein the configuration information includes at least informationabout a socket corresponding to the first service process; according tothe configuration information, creating a second service process; andswitching the service reloading state to the open state, and afterdetermining one of the service processes in the system service torespond to the call request according to the process attribute, themethod further includes: switching the service reloading state to theclose state; and terminating the service process that is not used torespond to the call request.
 3. The method of claim 2, wherein, when theprocess attribute is in a form of a character parameter and after thesecond service process is created according to the configurationinformation, the method further includes: configuring the characterparameter in the configuration information corresponding to the secondservice process, wherein the character parameter is used to mark thesocket of the newly created service process.
 4. The method of claim 3,wherein determining one of the service processes in the system serviceto respond to the call request according to the process attributefurther includes: calculating the service processes in the systemservice according to the character parameters to obtain a calculatedprocess value corresponding to each service process; and choosing one ofthe service processes to respond to the call request according to thecalculated process value.
 5. The method of claim 4, wherein performing acalculation process on the service processes in the system serviceaccording to the character parameter includes: performing a weightedcalculation on the service processes in the system service according tothe character parameter; and/or performing an accumulated calculation onthe service processes in the system service according to the characterparameter.
 6. The method of claim 3, wherein, when the service reloadingstate is the close state, the method further includes: performing arestoration and reset operation on the label of the socket of the secondservice process.
 7. The method of claim 1, wherein, when the processattributes are in a form of a time parameter recording a service processcreation time, choosing one of the service processes in the systemservice to respond to the call request according to the processattributes includes: comparing the time parameters of all serviceprocesses with a system restart time; determining target serviceprocesses according to the comparison results, wherein the targetservice process is a service process that has a positive time differencebetween its time parameter and the system restart time; and randomlyselecting a target service process among the target service processes asthe service process to respond to the call request.
 8. A system servicereloading apparatus, comprising: a receiving module configured toreceive a call request calling for a system service, wherein the systemservice includes at least two service processes having the sameconfiguration information; a processing module configured to determinewhether to perform a system service reloading according to apre-configured service reloading state, wherein the service reloadingstate includes at least an open state and a close state; a firstacquisition module configured to obtain a process attributecorresponding to the service processes when the service reloading stateis the open state, wherein the process attribute is used to record acreation order of the service processes; and a choosing moduleconfigured to choose one of the service processes in the system serviceto respond to the call request according to the process attribute. 9.The apparatus of claim 8, further including: a second acquisition moduleconfigured to obtain configuration information of a first serviceprocess in operation, wherein the configuration information includes atleast information about a socket corresponding to the first serviceprocess; a creation module configured to create a second service processaccording to the configuration information; a first configuration moduleconfigured to configure the service reloading state to the open state; asecond configuration module configured to configure the servicereloading state to the close state; and a termination module configuredto terminate the service process that is not used to respond to the callrequest.
 10. The apparatus of claim 9, wherein, when the processattribute is in a form of a character parameter, the apparatus furtherincludes: a first marking module configured to configure a characterparameter in the configuration information corresponding to the secondservice process, wherein the character parameter is used to mark thesocket of the newly created service process.
 11. The apparatus of claim10, wherein the determination module includes: a calculation unitconfigured to perform calculations on the service processes in thesystem service according to the character parameters to obtain acalculated process value corresponding to each service process; and afirst determination unit configured to determine one of the serviceprocesses to respond to the call request according to the calculatedprocess value.
 12. The apparatus of claim 11, wherein the calculationunit is configured to: perform weighted calculations on the serviceprocesses in the system service according to the character parameter;and/or perform accumulated calculations on the service processes in thesystem service according to the character parameter.
 13. The apparatusof claim 10, wherein, when the service reloading state is the closestate, the apparatus further includes: a marker restoration moduleconfigured to perform a restoration and reset process on the label ofthe socket of the second service process.
 14. The apparatus of claim 8,wherein, when the process attribute is in a form of a time parameterrecording a service process creation time, the choosing module includes:a comparing unit configured to compare the time parameters of allservice processes with a system restart time; a second determining unitconfigured to determine target service processes according to thecomparison results, wherein the target service process is a serviceprocess that has a positive time difference between its time parameterand the system restart time; and a selecting unit configured to randomlyselect a target service process among the target service processes asthe service process to respond to the call request.